home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / cnrbas.zip / CNRBASE.H < prev    next >
Text File  |  1992-10-13  |  5KB  |  128 lines

  1. /*********************************************************************
  2.  *                                                                   *
  3.  * MODULE NAME :  cnrbase.h              AUTHOR:  Rick Fishman       *
  4.  * DATE WRITTEN:  10-09-92                                           *
  5.  *                                                                   *
  6.  * DESCRIPTION:                                                      *
  7.  *                                                                   *
  8.  *  Common definitions and function prototypes for CNRBASE.EXE       *
  9.  *                                                                   *
  10.  * HISTORY:                                                          *
  11.  *                                                                   *
  12.  *  10-09-92 - File Created                                          *
  13.  *                                                                   *
  14.  *  Rick Fishman                                                     *
  15.  *  Code Blazers, Inc.                                               *
  16.  *  4113 Apricot                                                     *
  17.  *  Irvine, CA. 92720                                                *
  18.  *  CIS ID: 72251,750                                                *
  19.  *                                                                   *
  20.  *********************************************************************/
  21.  
  22. /*********************************************************************/
  23. /*------------------- APPLICATION DEFINITIONS -----------------------*/
  24. /*********************************************************************/
  25.  
  26. #define ID_FIRST_DIRWINDOW  1         // Id of first Directory frame window
  27.  
  28. #define ID_RESOURCES        1         // Id of frame wnd resources in .RC file
  29.  
  30. #define CNR_DIRECTORY       30        // The start of our show
  31.  
  32. #define IDM_ICON            1101      // Menu options
  33. #define IDM_NAME            1102
  34. #define IDM_TREE            1103
  35. #define IDM_DETAILS         1104
  36. #define IDM_TEXT            1105
  37.  
  38. #define UM_CONTAINER_FILLED WM_USER   // Posted by Fill thread to primary thread
  39.  
  40. #define DEBUG_FILENAME      "cnrbase.dbg"
  41.  
  42. #define DIRECTORY_WINCLASS  "CnrBaseSample"
  43.  
  44. #define PROGRAM_TITLE       "CNRBASE Container Sample"
  45.  
  46. #define HABERR( hab )       (ERRORIDERROR( WinGetLastError( hab ) ))
  47.  
  48. #define ANCHOR( hwnd )      (WinQueryAnchorBlock( hwnd ))
  49.  
  50. #define HWNDERR( hwnd )      \
  51.             (ERRORIDERROR( WinGetLastError( WinQueryAnchorBlock( hwnd ) ) ))
  52.  
  53. #define INSTDATA( hwnd )     (WinQueryWindowPtr( hwnd, 0 ))
  54.  
  55. #define PARENT( hwnd )       (WinQueryWindow( hwnd, QW_PARENT ))
  56.  
  57. #define GRANDPARENT( hwnd )  (WinQueryWindow( WinQueryWindow(hwnd, QW_PARENT)))
  58.  
  59. /**********************************************************************/
  60. /*---------------------------- STRUCTURES ----------------------------*/
  61. /**********************************************************************/
  62.  
  63. typedef struct _CNRITEM               // CONTAINER RECORD STRUCTURE
  64. {
  65.   MINIRECORDCORE rc;                  // Base information
  66.   PSZ            pszFileName;         // Pointer to File name
  67.   HPOINTER       hptrIcon;            // Icon handle
  68.   CDATE          date;                // Date of file
  69.   CTIME          time;                // Time of file
  70.   ULONG          cbFile;              // File size
  71.   CHAR           szFileName[CCHMAXPATH + 1]; // File name
  72.   ULONG          attrFile;            // Attributes of this file
  73.  
  74. } CNRITEM, *PCNRITEM;
  75.  
  76. #define EXTRA_RECORD_BYTES (sizeof( CNRITEM ) - sizeof( MINIRECORDCORE ))
  77.  
  78.  
  79. typedef struct _INSTANCE              // CONTAINER'S CLIENT WINDOW INSTANCE DATA
  80. {
  81.     BOOL fShutdown;                     // Main thread wants to shut down
  82.     BOOL fContainerFilled;              // Fill thread has completed
  83.     CHAR szCnrTitle[ CCHMAXPATH + 20 ]; // Container title
  84.     CHAR szDirectory[ CCHMAXPATH + 1 ]; // Directory being displayed
  85.  
  86. } INSTANCE, *PINSTANCE;
  87.  
  88.  
  89. typedef struct _THREADPARMS          // PARAMETERS TO PASS TO SECONDARY THREAD
  90. {
  91.     HWND hwndClient;                 // Client window handle
  92.  
  93. } THREADPARMS, *PTHREADPARMS;
  94.  
  95. /**********************************************************************/
  96. /*----------------------- FUNCTION PROTOTYPES ------------------------*/
  97. /**********************************************************************/
  98.  
  99. // In common.c
  100.  
  101. VOID SetWindowTitle( HWND hwndClient, PSZ szFormat, ... );
  102. VOID Msg( PSZ szFormat, ... );
  103.  
  104. // In create.c
  105.  
  106. HWND CreateDirectoryWin( PSZ szDirectory );
  107. HWND CreateContainer( HWND hwndClient, PSZ szDirectory );
  108.  
  109. // In populate.c
  110.  
  111. VOID PopulateContainer( PVOID pThreadParms );
  112.  
  113. /**********************************************************************/
  114. /*------------------------ GLOBAL VARIABLES --------------------------*/
  115. /**********************************************************************/
  116.  
  117. #ifdef GLOBALS_DEFINED
  118. #  define DATADEF
  119. #else
  120. #  define DATADEF extern
  121. #endif
  122.  
  123. DATADEF INT iWinCount;                  // Number of directory windows created
  124.  
  125. /***********************************************************************
  126.  *                   E N D     O F     S O U R C E                     *
  127.  **********************************************************************/
  128.